package test.nettys.zerocopy;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author wangshaopeng
 * @Date 2021/8/23
 */
public class OldServer {


    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8899);
        while (true){
            Socket socket = serverSocket.accept();
            DataInputStream dataInputStream = new DataInputStream(socket.getInputStream());
            int readCount = 0;
            while (readCount!=-1){
                byte[] bytes = new byte[4096];
                readCount = dataInputStream.read(bytes, 0, 4096);
            }
        }
    }
}
